package com.jxdinfo.hussar.example.cggl.materialpurchase.model;

import com.jxdinfo.hussar.platform.core.base.entity.BaseEntity;
import com.jxdinfo.hussar.support.mp.base.query.annotations.QueryAlias;
import org.apache.ibatis.type.Alias;
import java.util.List;
import com.jxdinfo.hussar.example.cggl.materialpurchase.model.MaterialPurchaseMaster;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.jxdinfo.hussar.example.cggl.materialpurchase.model.MaterialPurchaseItem;

/**
 * 采购信息表实体类
 */
@Alias("cggl.materialpurchase.MaterialPurchase")
public class MaterialPurchase implements BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 申请编号
     */
    @QueryAlias("T2.ID")
    private Long id;

    /**
     * 申请人
     */
    @QueryAlias("T2.APPLY_USER")
    private String applyUser;

    /**
     * 申请日期
     */
    @QueryAlias("T2.APPLY_DATE")
    private LocalDateTime applyDate;

    /**
     * 采购类型
     */
    @QueryAlias("T2.PURCHASE_TYPE")
    private String purchaseType;

    /**
     * 预估金额
     */
    @QueryAlias("T2.PRE_COST")
    private Double preCost;

    /**
     * 采购原因
     */
    @QueryAlias("T2.PURCHASE_REASON")
    private String purchaseReason;

    /**
     * 部门审核
     */
    @QueryAlias("T2.DEPT_AUTI")
    private String deptAuti;

    /**
     * 公司审核
     */
    @QueryAlias("T2.COMPANY_AUTI")
    private String companyAuti;

    /**
     * 采购明细表
     */
    private List<MaterialPurchaseItem> materialPurchaseItem;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getApplyUser() {
        return applyUser;
    }

    public void setApplyUser(String applyUser) {
        this.applyUser = applyUser;
    }

    public LocalDateTime getApplyDate() {
        return applyDate;
    }

    public void setApplyDate(LocalDateTime applyDate) {
        this.applyDate = applyDate;
    }

    public String getPurchaseType() {
        return purchaseType;
    }

    public void setPurchaseType(String purchaseType) {
        this.purchaseType = purchaseType;
    }

    public Double getPreCost() {
        return preCost;
    }

    public void setPreCost(Double preCost) {
        this.preCost = preCost;
    }

    public String getPurchaseReason() {
        return purchaseReason;
    }

    public void setPurchaseReason(String purchaseReason) {
        this.purchaseReason = purchaseReason;
    }

    public String getDeptAuti() {
        return deptAuti;
    }

    public void setDeptAuti(String deptAuti) {
        this.deptAuti = deptAuti;
    }

    public String getCompanyAuti() {
        return companyAuti;
    }

    public void setCompanyAuti(String companyAuti) {
        this.companyAuti = companyAuti;
    }

    public List<MaterialPurchaseItem> getMaterialPurchaseItem() {
        return materialPurchaseItem;
    }

    public void setMaterialPurchaseItem(List<MaterialPurchaseItem> materialPurchaseItem) {
        this.materialPurchaseItem = materialPurchaseItem;
    }

    @Override
    public String toString() {
        return "materialPurchase{" + "id=" + id + ", applyUser=" + applyUser + ", applyDate=" + applyDate + ", purchaseType=" + purchaseType + ", preCost=" + preCost + ", purchaseReason=" + purchaseReason + ", deptAuti=" + deptAuti + ", companyAuti=" + companyAuti + ", materialPurchaseItem=" + materialPurchaseItem + "}";
    }

    public MaterialPurchaseMaster gainMaterialPurchaseMaster() {
        MaterialPurchaseMaster materialPurchaseMaster = new MaterialPurchaseMaster();
        materialPurchaseMaster.setId(this.id);
        materialPurchaseMaster.setApplyUser(this.applyUser);
        materialPurchaseMaster.setApplyDate(this.applyDate);
        materialPurchaseMaster.setPurchaseType(this.purchaseType);
        materialPurchaseMaster.setPreCost(this.preCost);
        materialPurchaseMaster.setPurchaseReason(this.purchaseReason);
        materialPurchaseMaster.setDeptAuti(this.deptAuti);
        materialPurchaseMaster.setCompanyAuti(this.companyAuti);
        return materialPurchaseMaster;
    }

    public List<MaterialPurchaseItem> gainMaterialPurchaseItemArray() {
        return getMaterialPurchaseItem();
    }
}
